import requests

class TestUID:
# 登录
    @classmethod
    def login_ihrm(cls,body):
        url='http://ihrm-test.itheima.net/api/sys/login'
        header={"Content-Type": "application/json"}
        req=requests.post(url=url,headers=header,json=body)
        return req

# 添加
    @classmethod
    def add_ihrm(cls,token,body):
        url1="http://ihrm-test.itheima.net/api/sys/user"
        header1={"Content-Type":"application/json", "Authorization":token}
        req1=requests.post(url=url1,headers=header1,json=body)
        return req1





# 查询
    @classmethod
    def ser_ihrm(cls,id,token):
        url4="http://ihrm-test.itheima.net/api/sys/user/"+str(id)
        header4={"Authorization":token}
        req4=requests.get(url=url4,headers=header4)
        return req4

# 修改
    @classmethod
    def put_ihrm(cls,id,token,body):
        url2="http://ihrm-test.itheima.net/api/sys/user/"+str(id)
        header2={"Content-Type":"application/json", "Authorization":token}
        req2=requests.put(url=url2,headers=header2,json=body)
        return req2

# 删除
    @classmethod
    def delete_ihrm(cls,id,token):
        url3="http://ihrm-test.itheima.net/api/sys/user/"+str(id)
        header3={"Authorization":token}
        req3=requests.delete(url=url3,headers=header3)
        return req3
